import apibase from "@/api/apiBase";
import axios from "axios";
import { spreadAddInterface, spreadEditInterface } from "./promotion.interface";

//获取渠道列表
export const $spreadList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/spread/list',
    data: params,
    instance,
  });
}

//添加渠道
export const $spreadAdd = (params: spreadAddInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/spread/add',
    data: params,
    instance,
  });
}

//编辑渠道
export const $spreadEdit = (params: spreadEditInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/spread/edit',
    data: params,
    instance,
  });
}

//获取渠道人员列表
export const $spreadSalerList = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/spread/salerList',
    data: params,
    instance,
  });
}

//获取渠道人员二维码
export const $spreadGetSalerQrcode = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/female/spread/getSalerQrcode',
    data: params,
    instance,
  });
}

//添加渠道人员
export const $spreadAddSaler = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/spread/addSaler',
    data: params,
    instance,
  });
}

//编辑渠道人员
export const $spreadEditSaler = (params: any) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/female/spread/editSaler',
    data: params,
    instance,
  });
}